/***
 * @Author: 玄绮 shijiahansi@qq.com
 * @Date: 2024-06-09 09:28:58
 * @LastEditors: 玄绮 shijiahansi@qq.com
 * @LastEditTime: 2024-06-09 09:30:32
 * @FilePath: \server\dep\rdhttp\request\HttpRequest.h
 * @Description:
 * @
 * @Copyright (c) 2024 by 玄绮, All Rights Reserved.
 */

#if !defined(HTTP_REQUEST_H__)
#    define HTTP_REQUEST_H__

#    include <FormItem.h>
#    include <boost/beast.hpp>
#    include <boost/beast/http/message.hpp>
#    include <boost/beast/http/string_body.hpp>
#    include <fields/ContentDisposition.h>
#    include <fields/ContentType.h>
namespace rdhttp {

    class HttpSession;

    class HttpRequest
        : public boost::beast::http::request<boost::beast::http::string_body> {
    private:
        std::vector<FormItem> m_forms;
        friend HttpSession;

    protected:
        void parser_parts();

    public:
        /// Constructor
        HttpRequest() = default;

        /// Constructor
        HttpRequest(HttpRequest&&) = default;

        /// Constructor
        HttpRequest(HttpRequest const&) = default;

        HttpRequest(boost::beast::http::request<boost::beast::http::string_body>&&);
        HttpRequest(boost::beast::http::request<boost::beast::http::string_body> const&);

        std::vector<FormItem> const& forms();

        ContentType content_type() const;

        /// Assignment
        HttpRequest& operator=(HttpRequest&&) = default;

        /// Assignment
        HttpRequest& operator=(HttpRequest const&) = default;
        virtual ~HttpRequest();
    };
}  // namespace rdhttp

#endif  // HTTP_REQUEST_H__
